<div class="view list-token-item">
<div class="span-2">
<?php echo CHtml::link(CHtml::encode($data->tokenDate), array(
		'view',
		'id' => $data->id
	), array(
		'target' => '_blank'
	));
?></div>
<div class="span-3"><?php echo CHtml::encode($data->project->name); ?></div>
<div class="span-3"><?php echo $data->tokenYear; ?> 年 <?php echo $data->tokenMonth ?> 月</div>
<div class="span-3">第 <?php
					  echo Yii::app()->numberFormatter->format('0000', $data->number);
					  ?> 号</div>
<div class="span-5 item-meta">
	<?php echo CHtml::encode($data->createUser->employee->fullName); ?>
	(<?php echo CHtml::encode($data->createTime); ?>)
</div>
<div class="clear"></div>
<?php
$this
	->widget('zii.widgets.grid.CGridView',
		array(
			'id' => 'account-token-item-list-grid',
			'dataProvider' => new CArrayDataProvider($data->getRelated('items', true),
				array(
					'pagination' => false
				)),
			'enablePagination' => false,
			'columns' => array(
				array(
					'header' => '摘要',
					'type' => 'raw',
					'name' => 'summary',
					'footer' => '合计',
					'htmlOptions' => array(
						'width' => '40%'
					)
				),
				array(
					'header' => '科目',
					'name' => 'category.displayLongName',
					'htmlOptions' => array(
						'width' => '30%'
					),
					'footer' => $data->isBalanced() ? "" : "X"
				),
				array(
					'header' => '借方',
					'type' => 'currency',
					'name' => 'debit',
					'htmlOptions' => array(
						'width' => '15%'
					),
					'footer' => Yii::app()->format->formatCurrency($data->totalDebit)
				),
				array(
					'header' => '贷方',
					'type' => 'currency',
					'name' => 'credit',
					'htmlOptions' => array(
						'width' => '15%'
					),
					'footer' => Yii::app()->format->formatCurrency($data->totalCredit)
				),
			),
		));

?>
<div class="clear"></div>
</div>
